<!DOCTYPE HTML>
<html>
<head>
<title>Cloud Print Dialog unittest</title>
<script language="javascript">
  window.onload = onLoad;

  function onLoad() {
  }

  function testPageSetup() {
    var result = JSON.stringify({'dpi': 300,
                                 'selection_only': false});
    chrome.send('SetPageParameters', [result]);
  }

  function testWindowPrint() {
    window.print();
  }

  function testWindowClose() {
    window.close();
  }

  function testWindowSizeLarger() {
    window.resizeBy(0, 50);
  }

  function testWindowSizeSmaller() {
    window.resizeBy(0, -50);
  }

  function showDebugger() {
    onLoad();
    chrome.send('ShowDebugger', ['']);
  }

  function testSendPrintData() {
    chrome.send('SendPrintData', ['']);
  }
</script>
</head>
<body style='margin:0; border:0;'>
  <hr>
  <table border='0' width='100%'>
    <tr>
      <td align='right'>
        <input type='button' value='Open Debug Window' id='debug'
               onclick='showDebugger();'/>
        <input type='button' value='Test Send Data' id='data'
               onclick='testSendPrintData();'/>
        <input type='button' name='test' value='Test window.print()'
               onclick='testWindowPrint();'/>
      </td>
    </tr>
    <tr>
      <td align='right'>
        <input type='button' name='larger' value='Make Window Larger'
               onclick='makeWindowLarger();'/>
        <input type='button' name='smaller' value='Make Window Smaller'
               onclick='makeWindowSmaller();'/>
        <input type='button' name='test' value='Test Page Setup'
               onclick='testPageSetup();'/>
      </td>
    </tr>
    <tr>
      <td align='right'>
        <input type='button' value='Cancel' id='cancel' 
               onclick='testWindowClose();'/>
      </td>
    </tr>
  </table>
  <div id='message' style='font-weight:bolder;'>&nbsp;</div>
  <div id='advanced' class='advanced' style='display:none;'></div>
</body>
</html>
